package com.cloudbroker.bcs.platform.dav.middle.service.impl;

import com.cloudbroker.bcs.platform.dav.middle.dao.BrokerFinanceDAO;
import com.cloudbroker.bcs.platform.dav.middle.dao.base.TenantDAOBase;
import com.cloudbroker.bcs.platform.dav.middle.entity.BrokerFinance;
import com.cloudbroker.bcs.platform.dav.middle.entityexample.BrokerFinanceQueryCondition;
import com.cloudbroker.bcs.platform.dav.middle.entityview.VoteRecordListView;
import com.cloudbroker.bcs.platform.dav.middle.service.ZXBrokerFinanceService;
import com.cloudbroker.bcs.platform.dav.middle.service.base.TenantServiceImplBase;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created by zhaojp18008 on 2017/1/3.
 */
@Service
public class ZXBrokerFinanceServiceImpl extends TenantServiceImplBase<BrokerFinance, Long> implements ZXBrokerFinanceService {
    @Resource
    private BrokerFinanceDAO brokerFinanceDAO;
    @Override
    protected TenantDAOBase<BrokerFinance, Long> getDAO() {
        return brokerFinanceDAO;
    }

    @Override
    public BrokerFinance findTodayImport(Integer tenant_id, Long broker_id, Date today) {
        return brokerFinanceDAO.findTodayImport(tenant_id,broker_id,today);
    }

    @Override
    public List<BrokerFinance> findFinanceList(Integer tenant_id, Date today) {
        return brokerFinanceDAO.findFinanceList(tenant_id,today);
    }

    @Override
    public Date getLastImportTime(Integer tenantId) {
        return brokerFinanceDAO.getLastImportTime(tenantId);
    }

    @Override
    public List<VoteRecordListView> getFinanceOrderList(BrokerFinanceQueryCondition condition) {
        return brokerFinanceDAO.getFinanceOrderList(condition);
    }
}
